package com.xuecheng.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.content.model.dto.TeachplanDto;
import com.xuecheng.content.model.po.Teachplan;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 课程计划 Mapper 接口
 * </p>
 *
 * @author ybl
 */
public interface TeachplanMapper extends BaseMapper<Teachplan> {
    /**
     * @author ybl
     * @date 2023/3/3 9:29
     * @description 查询某课程的课程计划，组成树型结构
     * @since version-1.0
     */
    List<TeachplanDto> selectTreeNodes(long courseId);

    /**
     * @author ybl
     * @date 2023/3/6 16:32
     * @description 查询排序字段最大值
     * @param courseId 课程id
     * @param parentid 课程计划父级Id
     * @return java.lang.Integer
     * @since version-1.0
     */
    Integer selectMaxOrderby(@Param("courseId") long courseId, @Param("parentid") long parentid);
}
